using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System;

namespace ProjectManageSystemApi.DbEntity
{

    /// <summary>
    /// 用户角色关联表
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(Name = "sys_core_user_role_link", DisableSyncStructure = true)]
	public partial class SysCoreUserRoleLink {

		/// <summary>
		/// 主键
		/// </summary>
		[JsonProperty, Column(Name = "id", IsPrimary = true, IsIdentity = true)]
		public long Id { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[JsonProperty, Column(Name = "create_at", DbType = "datetime")]
		public DateTime CreateAt { get; set; }

		/// <summary>
		/// 创建人员
		/// </summary>
		[JsonProperty, Column(Name = "create_by")]
		public long? CreateBy { get; set; }

		/// <summary>
		/// 角色主键
		/// </summary>
		[JsonProperty, Column(Name = "role_id")]
		public long RoleId { get; set; }

		/// <summary>
		/// 状态(0:无效,1:有效)
		/// </summary>
		[JsonProperty, Column(Name = "status")]
		public int? Status { get; set; } = 1;

		/// <summary>
		/// 更新时间
		/// </summary>
		[JsonProperty, Column(Name = "update_at", DbType = "timestamp")]
		public DateTime? UpdateAt { get; set; }

		/// <summary>
		/// 更新人员
		/// </summary>
		[JsonProperty, Column(Name = "update_by")]
		public long? UpdateBy { get; set; }

		/// <summary>
		/// 用户主键
		/// </summary>
		[JsonProperty, Column(Name = "user_id")]
		public long? UserId { get; set; }


		[Navigate(nameof(RoleId))]
		public SysCoreRole Role { get; set; }

	}

}
